<?php

class PandradeAuth {

	public function __construct() {}
	
	public static function frontend($template='auth/links.tpl') {
		$view = Smarty_View::factory($template);
		if(Model_User::logged_in()) {
			$view->logout = true;
		} else {
			$view->login = true;
			if(Kohana::$config->load("pandrade")->public_register) $view->register = true;
		}
		return $view;
	}
	
	public static function backend($template='auth/links.tpl') {
		$view = Smarty_View::factory($template);
		$view->{Model_User::logged_in()?"logout":"login"} = true;
		return $view;
	}
	
} 